import axios from '@/utils/request'

const base = '/userserver'
const movieServer = '/movieserver'
const operation = '/operation'

export const getUserTotalCount = params => { return axios.get(`${base}/users/total`, { params: params }) }
export const getDeviceTotalCount = params => { return axios.get(`${base}/devices/total`, { params: params }) }
export const getOrgUnitCount = params => { return axios.get(`${base}/orgUnits/total`, { params: params }) }
export const getRoomCount = params => { return axios.get(`${base}/rooms/total`, { params: params }) }
export const getMovieCount = params => { return axios.get(`${movieServer}/movieInstances/total`, { params: params }) }
export const getOrgUnitTooltipData = orgUnitId => {
  const params = { orgUnitId }
  return axios.all([getOrgUnitCount({ orgUnitId, type: 1 }), getUserTotalCount(params), getDeviceTotalCount(params)])
}
export const getTodayActiveUserCount = params => { return axios.get(`${base}/users/todayActiveUser`, { params: params }) }

export const getBalanceTotal = params => { return axios.get(`${operation}/balances/total`, { params: params }) }
